﻿<?php
$queryTipoImovel = "select id_tipo, nome_tipo from tipo_imovel where ativado_tipo = 1 order by nome_tipo;";

$tipo_imovel = $conexao->prepare($queryTipoImovel);				

$tipo_imovel->execute();

$queryEndereco = "SELECT DISTINCT (bairro) FROM endereco order by bairro;";
		
$endereco = $conexao->prepare($queryEndereco);						
		
$endereco->execute();
?>

<div id="tipo-pesquisas">

	<form action="pesquisa-de-imoveis" method="post" class="jNice">

	<div id="pesquisas-completa">
    	
        	<span class="group">	
              <input type="radio" value="comprar" name="tipo_negocio" checked="checked"/>comprar
              <input type="radio" value="aluguel" name="tipo_negocio" class="radio_alugar" />alugar                           
          	</span>
          
          
          <div id="pesquisas-completa-select">
              <select name="tipo_imovel" id="tipo_imovel" style="width:242px;" tabindex="1">
              			    <option value="Tipo de imóvel">Tipo de imóvel</option> 
                          <?php
							  foreach($tipo_imovel as $lista) {	
						  ?>  
                                <option value="<?php echo $lista['id_tipo']; ?>"> <?php echo utf8_encode($lista['nome_tipo']); ?> </option>
                          <?php } ?>
              </select> 
           </div>
           
           <div id="pesquisas-completa-select2">
              <select name="bairro" id="bairro" style="width:242px;" tabindex="1">
       				    <option value="Bairro">Bairro</option>
                            
                           <?php						   	  
							  foreach($endereco as $listaEndereco) {	
						  ?>  
                                <option value="<?php echo retira_acentos($listaEndereco['bairro']); ?>"> 
								 	<?php echo utf8_encode($listaEndereco['bairro']); ?> </option>
                          <?php } ?>
              </select> 
           </div>
                                         
    </div> <!--Fim div PESQUISAS-COMPLETA-->
    
    <div id="pesquisas-complesta2">
    		
            <div id="pesquisas-completa-select3">
              <select name="valor" id="valor" style="width:242px;" tabindex="1">
                  <option value="Valores">Valores R$</option>                
                    
                    <optgroup label="Venda">
                        <option value="1000 à 50000">1.000,00 à 50.000,00</option>
                        <option value="51000 à 100000">51.000,00 à 100.000,00</option>
                        <option value="101000 à 200000">101.000,00 à 200.000,00</option>
                        <option value="201000 à 400000">201.000,00 à 400.000,00</option>
                        <option value="401000 à 800000">401.000,00 à 800.000,00</option>                        
                        <option value="mais de 800000">mais de 800.000,00</option>					
                	</optgroup>
                    
                    <optgroup label="Aluguel">
                      <option value="200 à 500">200,00 à 500,00</option>
                      <option value="501 à 800">501,00 à 800,00</option>
                      <option value="801 à 1200">801,00 à 1.200,00</option>
                      <option value="1201 à 1700">1.201,00 à 1.700,00</option>
                      <option value="1701 à 2500">1.701,00 à 2.500,00</option>
                      <option value="2501 à 5000">2.501,00 à 5.000,00</option>
                      <option value="mais de 5000">mais de 5.001,00</option>					
	              	</optgroup>
              </select> 
           </div>
           
           <p class="dormitorios">Dormitórios</p>
           <div id="pesquisas-completa-select4">
              <select name="dormitorio" id="dormitorio" style="width:59px;" tabindex="1">
              		  <option value="Nº">Nº</option>
                      <option value="1">1</option>
                      <option value="2">2</option>
                      <option value="3">3</option>
                      <option value="4">4</option>
                      <option value="5">5</option>
                      <option value="6">6</option>
                      <option value="7">7</option>
                      <option value="8">8</option>
                      <option value="9">9</option>
                      <option value="10">10</option>						
              </select> 
           </div>
           
           <p class="garagem">Garagem</p>
           <div id="pesquisas-completa-select4">
              <select name="garagem" id="garagem" style="width:59px;" tabindex="1">
			          <option value="Nº">Nº</option>
                      <option value="1">1</option>
                      <option value="2">2</option>
                      <option value="3">3</option>
                      <option value="4">4</option>
                      <option value="5">5</option>
                      <option value="6">6</option>
                      <option value="7">7</option>
                      <option value="8">8</option>
                      <option value="9">9</option>
                      <option value="10">10</option>						
              </select> 
           </div>
           
           <input type="submit" name="pesquisar" value="" class="botao" />
            
    		
    </div>
    </form>
    
    <div id="pesquisas-simples">
    	<form action="pesquisa-simples-imovel.php" method="post">
        	<input type="text" name="codigo_imovel" class="codigo">
            
            <input type="submit" class="botao" value="">
        </form>
    </div>
</div>
